<template></template>
<script>
export default {
  name: 'ImportPhoto',
  data() {
    return {}
  },
  methods: {
    handleOpenDialog(uuids, subUuid = '暂无子集',name = '已选') {
      console.log('打开')
      const VDOM = this.$createElement
      this.$msgbox({
        title: '操作提醒',
        message: VDOM('div', {}, [
          VDOM('div', {}, `该操作会将${name}人员照片删除！`),
          VDOM('div', {
            style: {
              color: 'red',
              marginTop: '8px'
            }
          }, '您真的确认要删除吗？')
        ]),
        confirmButtonText: '是',
        showCancelButton: true,
        cancelButtonText: '否',
        type: 'warning',
        beforeClose: this.handleEditDialog
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    handleOffDialog() {
      console.log('关闭')
      this.$emit('handleOffDialog')
    },
    handleEditDialog(action, _, done) {
      if (action === 'confirm') {
        console.log('处理修改数据')
        setTimeout(() => {
          done()
          this.handleOffDialog()
        }, 3000)
      } else {
        done()
        this.handleOffDialog()
      }
    }
  }
}
</script>
